POV-Ray : Newsgroups : povray.general : Point along a line. : Re: Point along a line. Server Time
5 Nov 2024 03:15:40 EST (-0500)
  Re: Point along a line.  
From: BorisW37
Date: 18 Jul 2003 19:30:01
Message: <web.3f18821015c57b22a6ac136d0@news.povray.org>
BorisW37 wrote:
>If i have 2 points A <x1,y1,z1> and B <x2,y2,z2>, how do i find coordinates
>of point C <x3,y3,z3> which lies on the line AB, distance D from point A?
>
>Thank you,
>
>Boris.
>

I got it:
First find D=distance between A and B
D=sqrt((x2-x1)^2+(y2-y1)^2+(z2-z1)^2)
then
x3=x1+d/D(x2-x1)
y3=y1+d/D(y2-y1)
z3=z1+d/D(z2-z1)

but now i have another question, if I have a vector named my_vector
# declare my_vector=<1,2,3>;

how do i find individual values of x,y and z
so that i could find
#declare my_vector_X=.....; (shoud be 1)
#declare my_vector_Y=.....; (shoud be 2)
#declare my_vector_Z=.....; (shoud be 3)


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.